<script type="text/javascript">
    $(document).ready(function() {
        $('.btn-toggle .btn').click(function() {
            $(this).toggleClass('active');
        });
    });
</script>

<li>
    <div class="btn-group btn-toggle" style="padding-top: 2px;"> 
        {% for Language in languages %}
            <a href="{{ app.cleanUri }}?locale={{ Language.slug }}" class="btn btn-lg {% if app.locale == Language.slug %}btn-primary active{% else %}btn-default{% endif %}">{{ Language.slug|upper }}</a>
        {% endfor %}
    </div>
</li>